package com.gsn.poker.play;

import aurelienribon.tweenengine.Tween;
import aurelienribon.tweenengine.equations.Linear;

import com.badlogic.gdx.graphics.g2d.TextureAtlas.AtlasRegion;
import com.badlogic.gdx.scenes.scene2d.Group;
import com.badlogic.gdx.scenes.scene2d.ui.Image;
import com.gsn.desktop.engine.ActorUtility;
import com.gsn.engine.gdx.GsnRotationImage;
import com.gsn.engine.myplay.GsnGame;
import com.gsn.engine.tween.ActorAccessor;
import com.gsn.engine.tween.GsnTween;
import com.gsn.poker.game.MyPoker;

public class RotationGroup extends Group {

	public RotationGroup(AtlasRegion nen, AtlasRegion chu, String name) {
		super(name);
		transform = GsnGame.transform;
		GsnRotationImage bg = new GsnRotationImage(nen);
		addActor(bg);
		this.width = bg.width;
		this.height = bg.height;
		bg.setCenter(width / 2, height / 2);
		Image img = new Image(chu);
		ActorUtility.setCenter(img, width / 2, height / 2);

		addActor(img);

		Tween.to(bg, ActorAccessor.ROTATION_CENTER, 2f).target(360).ease(Linear.INOUT).repeat(10, 0).start(MyPoker.game.tweenManger);

	}

}
